package com.example.demo.Entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import org.hibernate.annotations.CreationTimestamp;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import java.util.Date;

/**
 * @version: V0.3
 * @author: 郑皓杰 吴嘉鑫
 * @className: Employee
 * @packageName: com.example.demo.Entity
 * @description: 这是员工实体类
 * @data: 2021-07-14
 **/



@JsonIgnoreProperties({"hibernateLazyInitializer","handler"})//是因为查询到的对象是null值没有获取到，无法反序列化为json 返回到前台
@Entity
@Table(name="employee")
public class Employee{
	
	/**
	 * 员工ID
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)//主键自增
	private Integer empid;
	
	/**
	 * 员工用户名
	 */
	private String username;
	
	/**
	 * 员工真名
	 */
	private String realname;
	
	/**
	 * 员工性别
	 */
	private String gender;
	
	/**
	 * 员工生日
	 */
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date birth;
	
	/**
	 * 员工邮箱
	 */
	private String email;
	
	/**
	 * 员工电话
	 */
	private String telephone;
	
	/**
	 * 员工所属公司ID
	 */
	private Integer companyID;
	
	/**
	 * 员工所属公司名
	 */
	private String companyName;
	
	
	/**
	 * 期望年薪
	 */
	private Integer expectedsalary;
	
	
	/**
	 * 是否自由人
	 */
	private boolean isFree;
	
	
	/**
	 * 标签集合
	 */
	//private Map<String, String> labels;
	
	@CreationTimestamp
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date updated;
	
	@CreationTimestamp
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	private Date created;

	public Integer getEmpid() {
		return empid;
	}

	public void setEmpid(Integer empid) {
		this.empid = empid;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public Date getBirth() {
		return birth;
	}

	public void setBirth(Date birth) {
		this.birth = birth;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public Integer getCompanyID() {
		return companyID;
	}

	public void setCompanyID(Integer companyID) {
		this.companyID = companyID;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public Date getUpdated() {
		return updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	@Override
	public String toString() {
		return "Employee [empid=" + empid + ", username=" + username + ", realname=" + realname + ",  gender=" + gender + ", birth=" + birth + ", email=" + email + ", telephone=" + telephone
				+ ", companyID=" + companyID + ", companyName=" + companyName + ", updated=" + updated + ", created="
				+ created + "]";
	}

	public Integer getExpectedsalary() {
		return expectedsalary;
	}

	public void setExpectedsalary(Integer expectedsalary) {
		this.expectedsalary = expectedsalary;
	}

	public boolean isFree() {
		return isFree;
	}

	public void setFree(boolean isFree) {
		this.isFree = isFree;
	}

//	public Map<String, String> getLabels() {
//		return labels;
//	}

//	public void setLabels(Map<String, String> labels) {
//		this.labels = labels;
//	}

}
